package com.dzsw.utils;

/**
 * @author sunz
 * @version 1.0
 * @CreateTime 2021-04-21-14:57
 */
public class StringUtils {

    public static String combineStr(String... strings) {
        return combineStr0(strings).toString();
    }

    public static StringBuilder combineStr0(String... strings) {
        StringBuilder stringBuilder = new StringBuilder();
        if (strings == null || strings.length <= 0) {
            return stringBuilder;
        }
        for (String str : strings) {
            stringBuilder.append(str);
        }
        return stringBuilder;
    }

    public static void main(String[] args) {
        String s = combineStr("This is a test. ",
                "My friend.",
                "\n",
                "Oh, that's right."
        );

        System.out.println(s);
    }
}
